﻿using System;

namespace AOP.Attribute
{
    /// <summary>
    /// Aop日志标识属性
    /// </summary>
    [AttributeUsage(AttributeTargets.Class | AttributeTargets.Method | AttributeTargets.Property, AllowMultiple = false, Inherited = false)]
    public sealed class AopLogoAttribute : System.Attribute
    {
        /// <summary>
        /// 主题
        /// </summary>
        public string Topic
        {
            get;
            private set;
        }

        /// <summary>
        /// 执行步骤
        /// </summary>
        public string Step
        {
            get;
            private set;
        }

        /// <summary>
        /// 构造函数初始化
        /// </summary>
        public AopLogoAttribute()
        {

        }

        /// <summary>
        /// 构造函数初始化
        /// </summary>
        /// <param name="step">步骤</param>
        public AopLogoAttribute(string step)
        {
            Step = step;
        }

        /// <summary>
        /// 构造函数初始化
        /// </summary>
        /// <param name="topic">主题</param>
        /// <param name="step">步骤【总入口方法step=0，其余按执行顺序递增】</param>
        public AopLogoAttribute(string topic, string step)
        {
            Topic = topic;
            Step = step;
        }
    }
}
